package com.lance.answer.gui.answer.gk.answer.lms.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

import java.util.List;

@NoArgsConstructor
@Data
public class LmsExamInfo {
    @JsonProperty("end")
    private Integer end;
    @JsonProperty("exams")
    private List<ExamsDTO> exams;
    @JsonProperty("page")
    private Integer page;
    @JsonProperty("page_size")
    private Integer pageSize;
    @JsonProperty("pages")
    private Integer pages;
    @JsonProperty("start")
    private Integer start;
    @JsonProperty("total")
    private Integer total;

    @NoArgsConstructor
    @Data
    public static class ExamsDTO  implements Comparable<ExamsDTO>{
        @JsonProperty("announce_answer_status")
        private String announceAnswerStatus;
        @JsonProperty("announce_answer_time")
        private Object announceAnswerTime;
        @JsonProperty("announce_answer_type")
        private Object announceAnswerType;
        @JsonProperty("announce_score_status")
        private String announceScoreStatus;
        @JsonProperty("announce_score_time")
        private Object announceScoreTime;
        @JsonProperty("assign_group_ids")
        private List<?> assignGroupIds;
        @JsonProperty("assign_student_ids")
        private List<?> assignStudentIds;
        @JsonProperty("created_by")
        private CreatedByDTO createdBy;
        @JsonProperty("end_time")
        private String endTime;
        @JsonProperty("from_master")
        private Boolean fromMaster;
        @JsonProperty("group_set_id")
        private Integer groupSetId;
        @JsonProperty("group_set_name")
        private String groupSetName;
        @JsonProperty("has_assign_group")
        private Boolean hasAssignGroup;
        @JsonProperty("has_assign_student")
        private Boolean hasAssignStudent;
        @JsonProperty("has_random_subject")
        private Boolean hasRandomSubject;
        @JsonProperty("has_temporary_submission")
        private Boolean hasTemporarySubmission;
        @JsonProperty("id")
        private Long id;
        @JsonProperty("is_announce_answer_time_passed")
        private Boolean isAnnounceAnswerTimePassed;
        @JsonProperty("is_announce_score_time_passed")
        private Boolean isAnnounceScoreTimePassed;
        @JsonProperty("is_assigned_to_all")
        private Boolean isAssignedToAll;
        @JsonProperty("is_closed")
        private Boolean isClosed;
        @JsonProperty("is_final")
        private Boolean isFinal;
        @JsonProperty("is_ip_constrained")
        private Boolean isIpConstrained;
        @JsonProperty("is_started")
        private Boolean isStarted;
        @JsonProperty("is_submit_started")
        private Boolean isSubmitStarted;
        @JsonProperty("last_updated_at")
        private String lastUpdatedAt;
        @JsonProperty("last_updated_by")
        private String lastUpdatedBy;
        @JsonProperty("limit_time")
        private Object limitTime;
        @JsonProperty("limited_ip")
        private Object limitedIp;
        @JsonProperty("make_up_record")
        private Object makeUpRecord;
        @JsonProperty("makeup_exam_submission_count")
        private Integer makeupExamSubmissionCount;
        @JsonProperty("prerequisites")
        private List<?> prerequisites;
        @JsonProperty("referrer_id")
        private Long referrerId;
        @JsonProperty("referrer_type")
        private String referrerType;
        @JsonProperty("score_percentage")
        private String scorePercentage;
        @JsonProperty("score_rule")
        private String scoreRule;
        @JsonProperty("start_time")
        private String startTime;
        @JsonProperty("subjects_count")
        private Integer subjectsCount;
        @JsonProperty("subjects_rule")
        private SubjectsRuleDTO subjectsRule;
        @JsonProperty("submission_count")
        private Integer submissionCount;
        @JsonProperty("submit_by_group")
        private Boolean submitByGroup;
        @JsonProperty("submit_start_time")
        private String submitStartTime;
        @JsonProperty("submit_times")
        private Integer submitTimes;
        // 标题
        @JsonProperty("title")
        private String title;
        @JsonProperty("type")
        private String type;
        @JsonProperty("final_score")
        private Object finalScore;
        @JsonProperty("score")
        private String score;
        @JsonProperty("makeup_exam_paper")
        private MakeupExamPaperDTO makeupExamPaper;

        @Override
        public int compareTo(@NotNull ExamsDTO o) {
            return Long.compare( this.id,o.id);
        }

        @NoArgsConstructor
        @Data
        public static class CreatedByDTO {
            @JsonProperty("id")
            private long id;
            @JsonProperty("name")
            private String name;
        }

        @NoArgsConstructor
        @Data
        public static class SubjectsRuleDTO {
            @JsonProperty("select_subjects_randomly")
            private Boolean selectSubjectsRandomly;
            @JsonProperty("shuffle_options_randomly")
            private Boolean shuffleOptionsRandomly;
            @JsonProperty("shuffle_subjects_randomly")
            private String shuffleSubjectsRandomly;
        }

        @NoArgsConstructor
        @Data
        public static class MakeupExamPaperDTO {
            @JsonProperty("id")
            private long id;
            @JsonProperty("subjects_count")
            private Integer subjectsCount;
        }
    }

/**
 * {"end":5,"exams":[{"announce_answer_status":"no_announce","announce_answer_time":null,"announce_answer_type":null,"announce_score_status":"immediate_announce","announce_score_time":null,"assign_group_ids":[],"assign_student_ids":[],"created_by":{"id":1,"name":"admin\u7ba1\u7406\u5458"},"end_time":"2022-07-01T15:59:59Z","from_master":true,"group_set_id":0,"group_set_name":"","has_assign_group":false,"has_assign_student":false,"has_random_subject":true,"has_temporary_submission":false,"id":139542,"is_announce_answer_time_passed":false,"is_announce_score_time_passed":true,"is_assigned_to_all":true,"is_closed":false,"is_final":false,"is_ip_constrained":false,"is_started":true,"is_submit_started":true,"last_updated_at":"2022-04-07T10:03:31Z","last_updated_by":"admin\u7ba1\u7406\u5458","limit_time":null,"limited_ip":null,"make_up_record":null,"makeup_exam_submission_count":0,"prerequisites":[],"referrer_id":391499,"referrer_type":"syllabus","score_percentage":"20.0","score_rule":"highest","start_time":"2022-02-28T16:00:00Z","subjects_count":42,"subjects_rule":{"select_subjects_randomly":false,"shuffle_options_randomly":false,"shuffle_subjects_randomly":"default"},"submission_count":0,"submit_by_group":false,"submit_start_time":"2022-03-01T00:00:00Z","submit_times":4,"title":"\u5f62\u8003\u4efb\u52a14\uff0820\u5206\uff09","type":"exam"},{"announce_answer_status":"no_announce","announce_answer_time":null,"announce_answer_type":null,"announce_score_status":"immediate_announce","announce_score_time":null,"assign_group_ids":[],"assign_student_ids":[],"created_by":{"id":1,"name":"admin\u7ba1\u7406\u5458"},"end_time":"2022-07-01T15:59:59Z","from_master":true,"group_set_id":0,"group_set_name":"","has_assign_group":false,"has_assign_student":false,"has_random_subject":true,"has_temporary_submission":false,"id":139540,"is_announce_answer_time_passed":false,"is_announce_score_time_passed":true,"is_assigned_to_all":true,"is_closed":false,"is_final":false,"is_ip_constrained":false,"is_started":true,"is_submit_started":true,"last_updated_at":"2022-04-07T10:03:30Z","last_updated_by":"admin\u7ba1\u7406\u5458","limit_time":null,"limited_ip":null,"make_up_record":null,"makeup_exam_submission_count":0,"prerequisites":[],"referrer_id":391499,"referrer_type":"syllabus","score_percentage":"20.0","score_rule":"highest","start_time":"2022-02-28T16:00:00Z","subjects_count":42,"subjects_rule":{"select_subjects_randomly":false,"shuffle_options_randomly":false,"shuffle_subjects_randomly":"default"},"submission_count":0,"submit_by_group":false,"submit_start_time":"2022-03-01T00:00:00Z","submit_times":4,"title":"\u5f62\u8003\u4efb\u52a13\uff0820\u5206\uff09","type":"exam"},{"announce_answer_status":"no_announce","announce_answer_time":null,"announce_answer_type":null,"announce_score_status":"immediate_announce","announce_score_time":null,"assign_group_ids":[],"assign_student_ids":[],"created_by":{"id":1,"name":"admin\u7ba1\u7406\u5458"},"end_time":"2022-07-01T15:59:59Z","from_master":true,"group_set_id":0,"group_set_name":"","has_assign_group":false,"has_assign_student":false,"has_random_subject":true,"has_temporary_submission":false,"id":139537,"is_announce_answer_time_passed":false,"is_announce_score_time_passed":true,"is_assigned_to_all":true,"is_closed":false,"is_final":false,"is_ip_constrained":false,"is_started":true,"is_submit_started":true,"last_updated_at":"2022-04-07T10:03:29Z","last_updated_by":"admin\u7ba1\u7406\u5458","limit_time":null,"limited_ip":null,"make_up_record":null,"makeup_exam_submission_count":0,"prerequisites":[],"referrer_id":391499,"referrer_type":"syllabus","score_percentage":"20.0","score_rule":"highest","start_time":"2022-02-28T16:00:00Z","subjects_count":42,"subjects_rule":{"select_subjects_randomly":false,"shuffle_options_randomly":false,"shuffle_subjects_randomly":"default"},"submission_count":0,"submit_by_group":false,"submit_start_time":"2022-03-01T00:00:00Z","submit_times":4,"title":"\u5f62\u8003\u4efb\u52a12\uff0820\u5206\uff09","type":"exam"},{"announce_answer_status":"no_announce","announce_answer_time":null,"announce_answer_type":null,"announce_score_status":"immediate_announce","announce_score_time":null,"assign_group_ids":[],"assign_student_ids":[],"created_by":{"id":1,"name":"admin\u7ba1\u7406\u5458"},"end_time":"2022-07-01T15:59:59Z","final_score":null,"from_master":true,"group_set_id":0,"group_set_name":"","has_assign_group":false,"has_assign_student":false,"has_random_subject":true,"has_temporary_submission":false,"id":139533,"is_announce_answer_time_passed":false,"is_announce_score_time_passed":true,"is_assigned_to_all":true,"is_closed":false,"is_final":false,"is_ip_constrained":false,"is_started":true,"is_submit_started":true,"last_updated_at":"2022-04-07T10:03:28Z","last_updated_by":"admin\u7ba1\u7406\u5458","limit_time":null,"limited_ip":null,"make_up_record":null,"makeup_exam_submission_count":0,"prerequisites":[],"referrer_id":391499,"referrer_type":"syllabus","score":"64","score_percentage":"20.0","score_rule":"highest","start_time":"2022-02-28T16:00:00Z","subjects_count":42,"subjects_rule":{"select_subjects_randomly":false,"shuffle_options_randomly":false,"shuffle_subjects_randomly":"default"},"submission_count":1,"submit_by_group":false,"submit_start_time":"2022-03-01T00:00:00Z","submit_times":4,"title":"\u5f62\u8003\u4efb\u52a11\uff0820\u5206\uff09","type":"exam"},{"announce_answer_status":"no_announce","announce_answer_time":null,"announce_answer_type":null,"announce_score_status":"immediate_announce","announce_score_time":null,"assign_group_ids":[],"assign_student_ids":[],"created_by":{"id":1,"name":"admin\u7ba1\u7406\u5458"},"end_time":"2022-07-01T15:59:59Z","final_score":null,"from_master":true,"group_set_id":0,"group_set_name":"","has_assign_group":false,"has_assign_student":false,"has_random_subject":false,"has_temporary_submission":false,"id":139525,"is_announce_answer_time_passed":false,"is_announce_score_time_passed":true,"is_assigned_to_all":true,"is_closed":false,"is_final":false,"is_ip_constrained":false,"is_started":true,"is_submit_started":true,"last_updated_at":"2022-04-09T03:37:13Z","last_updated_by":"admin\u7ba1\u7406\u5458","limit_time":null,"limited_ip":null,"make_up_record":null,"makeup_exam_paper":{"id":139526,"subjects_count":0},"makeup_exam_submission_count":0,"prerequisites":[],"referrer_id":391382,"referrer_type":"syllabus","score":"72.7","score_percentage":"0.0","score_rule":"highest","start_time":"2022-03-01T00:00:00Z","subjects_count":11,"subjects_rule":{"select_subjects_randomly":false,"shuffle_options_randomly":false,"shuffle_subjects_randomly":"default"},"submission_count":1,"submit_by_group":false,"submit_start_time":"2022-03-01T00:00:00Z","submit_times":999,"title":"\u672c\u7ae0\u81ea\u6d4b","type":"exam"}],"page":1,"page_size":20,"pages":1,"start":1,"total":5}
 */


}
